package main

import "fmt"

type rect struct{
	width, height int
}

// 面积
func (r *rect) area() int {
	return r.width * r.height
}

// 周长
func (r *rect) perim() int {
	return 2 * r.width + 2 * r.height
}

func main(){
	var r rect = rect{5, 10}
	fmt.Print(r.area(), "  ")
	fmt.Println(r.perim())

	var rp *rect = &r
	fmt.Print(rp.area(), "  ")
	fmt.Println(rp.perim())
}

